"use strict";

var C = require('../common'),
    http = require('http');

module.exports = {

    type: 'server',

    load: function (owner, httpConfig, cb) {
        var port = httpConfig.port || 3000;

        http.createServer(owner.app.engine).listen(port, function(err) {
            if (err) return cb(err);

            owner.console('Http server is listening on port [' + port + '].');
            cb();
        });
    }
};